<include file="public@header">
<link rel="stylesheet" href="__STATIC__/hybit/css/new_style.css">
<body>
    <div class="bgbg headhead">
        <p class="mytitle">{:lang('Bind sub account')}</p>
        <form class="layui-form">
            <div class="z_bdzzh">
                <div class="z_bdzzhshow">
                    <h3>{:lang('USERNAME')}</h3>
                    <input type="text" name="username">
                </div>
                <div class="z_bdzzhshow">
                    <h3>{:lang('PASSWORD')}</h3>
                    <input type="password" name="password">
                </div>
                    
                <button class="z_bdzzhbtn" lay-submit>{:lang('Submit')}</button>
            </div>
        </form>
    </div>
</body>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['form','layer'],function(){
        var form = layui.form;
  
        //监听提交
        form.on('submit', function(data){
            var _this = $(this);
            _this.attr('disabled',true);
            $.ajax({
                type: 'post',
                url: '{:url("parent_son/bind")}',
                data:data.field,
                success:function(res){
                    layer.msg(res.msg);
                    if(res.code == 1){
                        setTimeout(function(){ window.history.go(-1); }, 1500);
                    }else{
                        _this.removeAttr('disabled');
                    }
                }
            });
        });
    });
</script>
</html>